<template>
  <div class="btnDialog">
    <div>
      <el-button type="primary" size="small" @click="openInvoice(true)"
                 v-if="hasAuth('VMS_FULL_ISSUE_NEGATIVE_INVOICE')">新增
      </el-button>
    </div>

    <invoiceDialog :invoiceDialogShow="invoiceDialogShow" @invoicingShow="invoicingShow"></invoiceDialog>
  </div>
</template>
<script>
import invoiceDialog from './invoiceDialog.vue'
import {checkStatus} from "@/api/manualNegativeInvoice";

export default {
  data() {
    return {
      invoiceDialogShow: false,
    }
  },
  methods: {
    async openInvoice() {
      const {code, data, msg} = await checkStatus();
      if (code == 200) {
        this.invoiceDialogShow = true
      }
    },

    invoicingShow(val) {
      this.invoiceDialogShow = val
    },
  },
  components: {
    invoiceDialog,
  }
}
</script>

<style lang="scss" scoped>
.btnDialog {
  margin-bottom: 6px;
}
</style>